#ifndef LIBRARY_H
#define LIBRARY_H
#include <string>
#include <map>
#include <exception>
class Book_t;
class Borrower_t;

typedef enum{
	BOOK_UKNOWN = 0,
	BOOK_OUT,
	BOOK_AVAILABLE,
} BookStatus;

typedef enum{
	BORROWER_REMOVE_FAIL = 0,
	BOOK_REMOVE_FAIL,
}LibraryException;

class Library_t{
public:
	Library_t();
	Library_t(const Library_t& lib);
	Library_t& operator=(const Library_t& lib);
	~Library_t();
	virtual bool AddBook(std::string ISBN,const Book_t *book);
	virtual bool AddBorrower(unsigned long id, const Borrower_t* borrower);
	virtual Book_t* RemoveBook(std::string ISBN) throw (LibraryException);
	virtual Book_t* SearchBook(std::string ISBN) const;
	virtual BookStatus Status(std::string ISBN) const;
	virtual bool Add(unsigned long ID,Borrower_t *borrower);
	virtual Borrower_t* RemoveBorrower(unsigned long ID) throw (LibraryException);
	virtual Borrower_t* SearchBorrower(unsigned long ID) const;
	virtual Book_t* Borrow(std::string ISBN, unsigned long ID);
	virtual bool Return(std::string ISBN, unsigned long ID);
	virtual void BooksReport() const;
	virtual void BorrowesReport() const;
private:
	std::map<std::string,const Book_t*> books;
	std::map<unsigned long,const Borrower_t*> borrowers;
};

#endif